package com.smart4j.framework.aop.spring.two;

import java.lang.reflect.Method;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

/**
 * description: 同时 实现 前置增强 MethodBeforeAdvice 和 后置增强 AfterReturningAdvice
 * @version v1.0
 * @author w
 * @date 2018年9月17日下午9:16:47
 */
public class GreetingBeforeAndAfterAdvice implements MethodBeforeAdvice, AfterReturningAdvice {

	@Override
	public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
		System.out.println(" after ----> "+ GreetingBeforeAndAfterAdvice.class.getSimpleName() +"method name: "+method.getName());

	}

	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		System.out.println(" before ----> "+GreetingBeforeAndAfterAdvice.class.getSimpleName() +"method name: "+method.getName());
	}

}
